Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call really_destroy! in validate_roles, to not throw error when role … #1444

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

njaeggi
Copy link
Contributor

@njaeggi njaeggi commented Dec 30, 2024

…will be deleted anyways

@njaeggi njaeggi linked an issue Dec 30, 2024 that may be closed by this pull request
it "is valid with membership in different section active since today" do
create_role(:matterhorn_mitglieder, "Mitglied", start_on: Time.zone.today)
expect(switch).to be_valid
expect(switch).to be_valid
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason calling .delete only fails when calling this method twice? In our request this method is called twice, resulting in this bug, to recreate it in this spec we have to call it twice...

@njaeggi njaeggi force-pushed the bug/1357/switch-stammsektion-with-new-role branch 2 times, most recently from f6020fc to a22fd73 Compare January 6, 2025 07:23
Copy link
Member

@TheWalkingLeek TheWalkingLeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dass der Bug nur auftritt wenn wir zweimal valid? aufrufen habe ich noch weitergeforscht.
Faktisch ist das Problem dass er beim zweiten mal aus irgendeinem Grund die old_role = roles_to_destroy.first welche als gelöscht gelten sollte doch noch in der overlap_validation findet. Beim ersten Mal klappts problemlos. Wir konnten das Phänomen soweit zurückfolgen dass in der DB aufgrund der Transaktion korrekt nichts geschrieben wird. Da das Ruby Objekt der old_role aber memoized ist, gibt es beim ersten valid? Call also wahrscheinlich changes auf dieses Objekt welches dann den zweiten valid? Call verwirrt?

@TheWalkingLeek TheWalkingLeek force-pushed the bug/1357/switch-stammsektion-with-new-role branch from dcc80ea to 9f6d72b Compare January 17, 2025 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Sektionswechsel mit Mitgliedschaft gültig ab heute
2 participants